Skip to content

Instantly share code, notes, and snippets.

@jnorthrup
Created April 20, 2020 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnorthrup/74e1960bf8d5c4dbc5a9394806118bf0 to your computer and use it in GitHub Desktop.
Save jnorthrup/74e1960bf8d5c4dbc5a9394806118bf0 to your computer and use it in GitHub Desktop.
kotlinc vs python3
jim@OJFQCCK22EVHS7YKLYN6LXTEZ2JR4HAZ:~/work/columnar/superannuate$ export JAVA_HOME=/opt/jdk-15/ JAVA_OPTS=-Xmx512m ;export PATH=/opt/jdk-15//bin/:$PATH;time kotlinc-jvm -jvm-target 13 -Xnew-inference -cp $(find ../cursor/target/ -name '*jar'|xargs -n999 echo|tr ' ' :) -script histogram.kts
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
1
emulating
import pandas as pd;
d1names=['SalesNo', 'SalesAreaID', 'date', 'PluNo', 'ItemName', 'Quantity', 'Amount', 'TransMode']
d1=pd.read_fwf('superannuated1909.fwf',
names=d1names,
colspecs=[(0, 11), (11, 15), (15, 25), (25, 40), (40, 60), (60, 82), (82, 103), (103, 108)])
for i in d1names: print( (i,len( d1[i].unique() )) )
--- groupClusters
(SalesNo, 1149923)
--- groupClusters
(SalesAreaID, 70)
--- groupClusters
(date, 226)
--- groupClusters
(PluNo, 260)
--- groupClusters
(ItemName, 267)
--- groupClusters
(Quantity, 67)
--- groupClusters
(Amount, 82)
--- groupClusters
(TransMode, 2)
[NHS, NMUY]
histogram.kts:42:30: warning: unchecked cast: Vect02<IOMemento, String?> /* = Pai2<Int, (Int) -> Pai2<IOMemento, String?>> */ to Vect02<TypeMemento, String?> /* = Pai2<Int, (Int) -> Pai2<TypeMemento, String?>> */
val columnar = Columnar(meta as Vect02<TypeMemento, String?>)
^
real 0m29.022s
user 1m20.682s
sys 0m0.863s
jim@OJFQCCK22EVHS7YKLYN6LXTEZ2JR4HAZ:~/work/columnar/superannuate$ time python3 histogram.py
('SalesNo', 1149923)
('SalesAreaID', 70)
('date', 226)
('PluNo', 260)
('ItemName', 267)
('Quantity', 67)
('Amount', 82)
('TransMode', 2)
['NHS' 'NMUY']
real 0m23.923s
user 0m17.372s
sys 0m1.188s
jim@OJFQCCK22EVHS7YKLYN6LXTEZ2JR4HAZ:~/work/columnar/superannuate$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment