logs archiveBotHelp.net / Freenode / #43oh / 2015 / August / 11 / 1
Rickta59
woah .. 47 .. new low water mark
Spirilis
wow, haha, just prototyped a rather compute intensive concept in php and guess what... it's slow as balls
as expected
now I'm wondering if it's worth picking up some Java to reimplement this. C would be too kludgy imo, C++ similar
good news is I don't need a goddamned lick of GUI or graphics here, so I can forget about all that
some multithreading would be nice though
and jdbc
Rickta59
you are writing a server in php Spirilis ?
vigs
"C would be too kludgy" how rude
Spirilis
more like a data miner
Rickta59
in php hmm ...
i remember a guy that worked for me .. he couldn't do anything except sql
he used to write things that should have been done in c with sql
IcePic
I had a cow-worker who wrote csh-scripts in perl, basically.
Rickta59
* granted it was pl/sql
IcePic
we had a most-stuff-should-be-perl going, and he just didnt perl.
Rickta59
perl : ) .. one of the first languages I extended
amazingly powerful .. amazingly ugly
IcePic
sure, but protesting by .. trying to not-code-perl in perl was strange.
Rickta59
i never took to csh
IcePic
me neither, I'm more of a sh,ksh,bash person.
Rickta59
bash .. yeah .. csh .. too west coast
kind of like how i feel about ruby
IcePic
since rc scripts are sh-ish and not (t)cshis
h
Rickta59
once ksh had interactive history .. i could stop listening to why csh was better line
compilers never cease to amaze me with their tricks
http://dpaste.com/25DACK2
i wanted a smaller is_digit function .. instead of sucking in all the ctype.h map crap
so i made a simple alternate version
looking at the asm it generated, kind of surpised me ..
i expected to see 2 compares
r12 is both the input register and the output
so if c is '0' ..
the add.b #0xffd0 .. sets the high bit 0x10000
if it is a '0'
kind of tricky
roxfan
converting range check into single compare is pretty common
you can even do it manually
if unsigned(x-low)<(high-low)
Rickta59
yeah, was just checking out clang and it does it too
http://dpaste.com/1E6BRQ0 although this one is a puzzler
i'm trying to figure out what it is really doing
the cmp must be setting the status register
but i'
the bic r2 ..
messing with the carry?
not surre
ah .. bit 0 is the carry flag
Spirilis
lol well been giving myself a crash course in java today
not too bad really
quite workable
my DB importer function is like 6% faster than my php equivalent lol
Rickta59
you could probably double that speed using perl
: )
Spirilis
now pondering how to organize the data in memory with java's various Collections features
this is mostly database limited anyhow
Rickta59
what db?
Spirilis
it's the computational engine that needs help here but I think reordering the data model a bit may help
mysql
the app as a whole isn't database limited, it pulls all the data into memory and uses it from there
Rickta59
using a real socket or a local one?
Spirilis
local
Rickta59
k
things have so changed since i was doing db stuff
Spirilis
takes about 50 seconds to import ... umm .... 658530 rows (5 double's, 1 int, 1 varchar(20))
and store it in a HashMap structure in java
Rickta59
used to be a machine might have 500MB of memory
Spirilis
53 seconds to pull that same data into a hierarchical hash array in php
hehe
Rickta59
we were constantly playing games to keep stuff cached
Spirilis
yeah
Rickta59
now .. fu*k it just put the whole db in memory
Spirilis
nowadays if you're really ambitious you can rent an amazon AWS instance with a sh*tton of memory
Rickta59
just map all the data onto a hard driver and use it with mmap
Spirilis
yeah I wonder if java has object reference capability with shared memory segments
i.e. store the sh*t in a /dev/shm file and boom instant "db import"
Rickta59
man people are so spoiled now ..
huge hw ..
free dbs
i remember spending 100ks of $
1200 seats at $200 a pop
+ the cost of the db
Spirilis
yep yep
the cost of being years ahead of the game and not even knowing it :)
Rickta59
smaller places i worked i woudl buy c-tree
and basically be the developer and db developer
c-tree before it had any sql
just a big isam db
that was still about $800
Spirilis
heh one thing you get comfortable with really quick with java is templates (or "Generics" as they call it)
HashMap<String,Integer[]> or whatever
declaring the key type (String) and the value's type (Integer array)
Rickta59
how large is your data set?
username3
Howdy all
Rickta59
afternoon username3
Spirilis
Rickta59: 658,530 rows (5 double's, 1 int, 1 varchar20)
although, in the future I would like to expand that a bit to fill in missing data and at some point..... expand it another order of magnitude :)
username3
Spirilis, thanks for sharing your NRF library for the MSP430 :) I know a couple people that have used it as a base
Rickta59
you should just spew the data out as a c++ file .. compile it and use boost
« prev 1 2 next »